9aac80
@@ -190,8 +190,8 @@
public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Obje
           }
         } else {
           LOG.debug("Column " + column + " is not a partition column");
-          semiJoin = semiJoin && !disableSemiJoinOptDueToExternalTable(parseContext.getConf(), ts, ctx);
-          if (semiJoin && ts.getConf().getFilterExpr() != null) {
+          if (semiJoin && !disableSemiJoinOptDueToExternalTable(parseContext.getConf(), ts, ctx)
+                  && ts.getConf().getFilterExpr() != null) {
             LOG.debug("Initiate semijoin reduction for " + column + " ("
                 + ts.getConf().getFilterExpr().getExprString());
 
